<?php foreach ($wall_posts as $wall): ?>
    <div id="wall-<?php echo $user["User"]["id"]; ?>-<?php echo $wall["Post"]["id"]; ?>" class="comment">
        <p><a href="<?php echo BASE_PATH; ?>/users/view/<?php echo $wall["Post"]["author_user_id"]; ?>"><?php echo $wall["User"]["name"]; ?></a></p>
        <p><?php echo $wall["Post"]["content"]; ?></p>
    <?php if (($this->session->get("user_id") == $wall["Post"]["author_user_id"]) || ($this->session->get("role_id") == 1)): ?>
        <p><a href="#" onclick="delete_wall(<?php echo $user["User"]["id"]; ?>, <?php echo $wall["Post"]["id"]; ?>); return false;">(delete)</a></p>
    <?php endif ?>
        <div class="post_comment_box-<?php echo $user["User"]["id"]; ?>-<?php echo $wall["Post"]["id"]; ?>">
        <?php foreach ($wall["Comments"] as $comment): ?>
            <div id="comment-<?php echo $user["User"]["id"]; ?>-<?php echo $comment["Comment"]["id"]; ?>" class="comment">
                <p><a href="<?php echo BASE_PATH; ?>/users/view/<?php echo $comment["Comment"]["author_user_id"]; ?>"><?php echo $comment["User"]["name"]; ?></a></p>
                <p><?php echo $comment["Comment"]["content"]; ?></p>
            <?php if (($this->session->get("user_id") == $comment["Comment"]["author_user_id"]) || ($this->session->get("role_id") == 1)): ?>
                <p><a href="#" onclick="delete_wall_comment(<?php echo $user["User"]["id"]; ?>, <?php echo $comment["Comment"]["id"]; ?>); return false;">(delete)</a></p>
            <?php endif ?>
            </div>
        <?php endforeach ?>
        <?php if ($this->session->get("authenticated") && $comment_enabled): ?>
                    <form action="" onsubmit="return send_wall_comment(this, <?php echo $wall["Post"]["id"]; ?>);">
                        <fieldset>
                            <input type="text" name="content_add_wall_comment" id="content_add_wall_comment"/><br/>
                            <input type="submit" name="submit" value="Post"/>
                        </fieldset>
                    </form>
        <?php endif ?>
                </div>
            </div>
<?php endforeach ?>